# ifndef __PrintUnits_H_
# define __PrintUnits_H_

# include "Units.h"
extern elevation_units_t g_ElevationUnit;

enum distance_units_t {
	unMetric   = 0,
	unNautical = 1,
	unStatute  = 2
};

extern distance_units_t g_DistanceUnit;

enum area_units_t {
	unSquareMeters = 0,
	unSquareFeet   = 1,
	unAcres        = 2,
	unHectares     = 3,
};

extern area_units_t g_AreaUnit;

enum azimuth_t {
	azDegrees     = 0,
	azCardinality = 1
	// TODO: support cardinality, magnetic azimuth etc
};

extern azimuth_t g_AzimuthFormat;

enum posfmt_t {
	pfDecimal = 0,
	pfDegrees = 1,
	pfMinutes = 2,
	pfSeconds = 3
};
extern posfmt_t g_PositionFormat;

///////////////////////////////////////////////////

void InitPrintUnits ();

void PrintInt         (TCHAR * _strOut, int   _nValue);
void PrintReal        (TCHAR * _strOut, float _fValue);

float GetElevationUnitInM (TCHAR * _strUnits);
float GetDistanceUnitInKM (TCHAR * _strUnits);

void PrintElevation (char * _strOut, TCHAR * _strUnitsOut, float _fElevation, elevation_units_t _ElevationInUnits = unMeters, bool _bInteger = false);
void PrintDepth       (TCHAR * _strOut, TCHAR * _strUnitsOut, float _fDepthInM);
void PrintDistance    (TCHAR * _strOut, TCHAR * _strUnitsOut, float _fDistanceInM);
void PrintArea        (TCHAR * _strOut, TCHAR * _strUnitsOut, float _fAreaInM2);
void PrintSpeed       (TCHAR * _strOut, TCHAR * _strUnitsOut, float _fSpeedInKmh);
void PrintVSpeed      (TCHAR * _strOut, TCHAR * _strUnitsOut, float _fSpeedInMps);
void PrintTemperature (TCHAR * _strOut, TCHAR * _strUnitsOut, float _fTemperatureInDegC);
void PrintDuration    (TCHAR * _strOut, DATE _dt);
void PrintAzimuth     (TCHAR * _strOut, float _fAzimuthInDeg);

struct point_t;
void PrintPosition (char * _strOut, const point_t & _pt);
void PrintLat (char * _strOut, float _y);
void PrintLon (char * _strOut, float _x);

# endif // __PrintUnits_H_